import type { FC, PropsWithChildren } from 'react'
import React from 'react'

interface IndexProps {
  value?: number | string
  onChange?: (v: string | number) => void
}

const Index: FC<PropsWithChildren<IndexProps>> = ({ children, value, onChange }) => {
  return (React.Children.map(children as React.ReactElement[], (child) => {
    return React.cloneElement(child, { checkedValue: value, onChange })
  }))
}

export default Index
